<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>卖家顾问需求管理系统 - 后台管理</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            margin: 0;
            padding: 0;
            background: #f5f7fa;
        }
        .sidebar {
            width: 240px;
            height: 100vh;
            background: #1f2937;
            position: fixed;
            left: 0;
            top: 0;
            overflow-y: auto;
            transition: all 0.3s;
        }
        .sidebar-header {
            padding: 20px;
            border-bottom: 1px solid #374151;
        }
        .sidebar-menu {
            padding: 16px 0;
        }
        .menu-item {
            padding: 12px 20px;
            color: #9ca3af;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .menu-item:hover {
            background: #374151;
            color: #ffffff;
        }
        .menu-item.active {
            background: #6366f1;
            color: #ffffff;
        }
        .menu-item i {
            width: 20px;
            text-align: center;
        }
        .main-content {
            margin-left: 240px;
            min-height: 100vh;
        }
        .topbar {
            background: #ffffff;
            padding: 16px 24px;
            border-bottom: 1px solid #e5e7eb;
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: sticky;
            top: 0;
            z-index: 100;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }
        .content-area {
            padding: 24px;
        }
    </style>
</head>
<body>
    <!-- 侧边栏 -->
    <div class="sidebar">
        <div class="sidebar-header">
            <h1 class="text-white text-xl font-bold">卖家顾问系统</h1>
            <p class="text-gray-400 text-sm mt-1">后台管理</p>
        </div>
        <div class="sidebar-menu">
            <div class="menu-item active" data-page="dashboard.html">
                <i class="fas fa-tachometer-alt"></i>
                <span>工作台</span>
            </div>
            <div class="menu-item" data-page="requirement-list.html">
                <i class="fas fa-list"></i>
                <span>需求管理</span>
            </div>
            <div class="menu-item" data-page="quotation-list.html">
                <i class="fas fa-tag"></i>
                <span>报价管理</span>
            </div>
            <div class="menu-item" data-page="agreement-list.html">
                <i class="fas fa-file-contract"></i>
                <span>协议管理</span>
            </div>
            <div class="menu-item" data-page="user-list.html">
                <i class="fas fa-users"></i>
                <span>用户管理</span>
            </div>
            <div class="menu-item" data-page="statistics.html">
                <i class="fas fa-chart-bar"></i>
                <span>数据统计</span>
            </div>
        </div>
    </div>

    <!-- 主内容区 -->
    <div class="main-content">
        <!-- 顶部导航栏 -->
        <div class="topbar">
            <div>
                <h2 class="text-lg font-semibold text-gray-800" id="pageTitle">工作台</h2>
            </div>
            <div class="flex items-center gap-4">
                <div class="relative cursor-pointer">
                    <i class="fas fa-bell text-gray-500 text-xl"></i>
                    <span class="absolute -top-1 -right-1 bg-red-500 text-white text-xs rounded-full w-5 h-5 flex items-center justify-center">5</span>
                </div>
                <div class="flex items-center gap-3 cursor-pointer">
                    <div class="w-8 h-8 bg-indigo-500 rounded-full flex items-center justify-center">
                        <i class="fas fa-user text-white text-sm"></i>
                    </div>
                    <span class="text-gray-700">管理员</span>
                    <i class="fas fa-chevron-down text-gray-500 text-sm"></i>
                </div>
            </div>
        </div>

        <!-- 内容区域 -->
        <div class="content-area" id="contentArea">
            <!-- 页面内容将在这里动态加载 -->
        </div>
    </div>

    <script>
        // 菜单切换
        document.querySelectorAll('.menu-item').forEach(item => {
            item.addEventListener('click', function() {
                document.querySelectorAll('.menu-item').forEach(i => i.classList.remove('active'));
                this.classList.add('active');
                
                const page = this.getAttribute('data-page');
                const title = this.querySelector('span').textContent;
                document.getElementById('pageTitle').textContent = title;
                
                // 加载页面内容
                loadPage(page);
            });
        });

        // 加载页面
        function loadPage(page) {
            fetch(page)
                .then(response => response.text())
                .then(html => {
                    document.getElementById('contentArea').innerHTML = html;
                })
                .catch(error => {
                    console.error('加载页面失败:', error);
                    document.getElementById('contentArea').innerHTML = '<div class="text-center py-20"><p class="text-gray-500">页面加载失败</p></div>';
                });
        }

        // 默认加载工作台
        loadPage('dashboard.html');
    </script>
</body>
</html>

